package com.sctvcloud.zhaohua_sd.ui.adapter.holder;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;

import com.ruihang.generalibrary.ui.widget.CustomEXImageView;
import com.ruihang.generalibrary.ui.widget.CustomFontTextView;
import com.sctvcloud.zhaohua_sd.R;
import com.sctvcloud.zhaohua_sd.beans.FTopic;
import com.sctvcloud.zhaohua_sd.ui.utils.GlideUtil;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/7/24 0024.
 */

public class TopicDetailTopHolder extends BaseAbsHolder<FTopic> {
    @BindView(R.id.item_top_detail_top_img)
    protected CustomEXImageView img;
    @BindView(R.id.item_top_detail_top_title)
    protected CustomFontTextView title;

    public TopicDetailTopHolder(Context context, View itemView) {
        super(context, itemView);
    }

    @Override
    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void setData(FTopic fTopic) {
        if (!TextUtils.isEmpty(fTopic.getTopTitle())) {
            title.setText(fTopic.getTopTitle());
        } else {
            title.setText("");
        }
        //title.setText(TextUtils.isEmpty(fTopic.getTopTitle()) ? context.getString(R.string.default_title) : fTopic.getTopTitle());
        if (!TextUtils.isEmpty(fTopic.getTopImage())) {
            GlideUtil.getGlideWithLarge169Def(context, fTopic.getTopImage()).into(img);
            //Glide.with(context).load(fTopic.getTopImage()).into(img);
        }
    }
}
